import tool from '../tool'
import util from '_util/index'
import logic from '_logic'
const store = util.store
import _ from 'lodash'

export default{
    changeTrByFieldVal(_this,col){
        let {field,val,rs,cell_id}=col;

        switch (field) {
            case 'status':
                switch (val) {
                    // case 1:
                    //     let style = 'background-color: rgba(33, 133, 208,0.3);';
                    //     util.eventEmit(_this, 'set_line_style', cell_id,style);
                    //     break;
                    // case 2:
                    // case 8:
                    //     util.eventEmit(_this, 'changeCellByFieldVal', {col});
                    //     break;
                }
                break;
        }
    },
    changeCellByFieldVal_on(_this,col){
        let {field,val,rs,cell_id}=col;

        switch (field) {
            case 'nick_name':
                util.eventOn(_this, 'changeCellByFieldVal', _this.changeCellByFieldVal);
                break;
        }
    },
    changeCellByFieldVal_emit(_this,col,param){
        let {field,val,rs,cell_id}=col;
        let fcol=param.col;
        if(fcol.cell_id!=cell_id) {
            return;
        }

        switch (field) {
            case 'nick_name':
                switch (fcol.val) {
                    case 2:
                        _this.cell_style = 'color:red;';
                        _this.$set(_this.col, 'rs', rs + '2');
                        break;
                    case 8:
                        _this.cell_style = 'color:blue;';
                        _this.$set(_this.col, 'rs', rs + '8');
                        break;
                }
                break;
        }
    }
};
